package com.zwt.controller;

import com.zwt.domain.TsPlatformUser;
import com.zwt.service.TsPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by zwt on 2018/8/24.
 */
@Controller
@RequestMapping("providerUser")
public class UserController {

    @Autowired
    private TsPlatformService tsPlatformService;

    @RequestMapping("selectById")
    @ResponseBody
    public TsPlatformUser selectById(Long id){
        return tsPlatformService.selectById(id);
    }


    @RequestMapping("queryAll")
    @ResponseBody
    public List<TsPlatformUser> queryAll(){
        List<TsPlatformUser> tsPlatformUserList = tsPlatformService.queryAll();
        return tsPlatformUserList;
    }

    @RequestMapping("queryOne/{id}")
    @ResponseBody
    public TsPlatformUser queryOne(@PathVariable("id") Long id){
        TsPlatformUser tsPlatformUser = tsPlatformService.selectById(id);
        return tsPlatformUser;
    }


    @RequestMapping("selectOne")
    @ResponseBody
    public TsPlatformUser selectOne(@RequestParam Long id){
        TsPlatformUser tsPlatformUser = tsPlatformService.selectById(id);
        return tsPlatformUser;
    }


    @RequestMapping("selectByMobile")
    @ResponseBody
    public TsPlatformUser selectByMobile(@RequestParam String mobile){
        TsPlatformUser tsPlatformUser = tsPlatformService.selectByMoblie(mobile);
        return tsPlatformUser;
    }
}
